package com.feige.thirtypart.send;


import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;


/**
 * @author feige
 */
public class EmailSenderService {
    
    private JavaMailSender javaMailSender;
    
    private String username;


    public void emailSender(String subject,String text,String to,String from){
        //一个简单的邮件
        SimpleMailMessage mailMessage = new SimpleMailMessage();
        mailMessage.setSubject(subject);
        mailMessage.setText(text);
        mailMessage.setTo(to);
        mailMessage.setFrom(from);
        javaMailSender.send(mailMessage);
    }


    public void emailSender(String text,String to){
        emailSender("小飞云课",text,to,username);
    }
}
